<template>
  <div class="modal_PopUp" v-show="visible" @click="closePopUp">
    <div class="modal-content" @click.stop>
      <div class="line"></div>
      <div class="modal-body">
        <!-- 插槽 -->
        <div class="picture"></div>
        <div class="describe">Original sweet black coffee</div>
        <div class="price">$560,00 - Discount 15%!</div>
        <div class="offerDetails">
          Cita rasa kopi hitam cianjur sudah dikenal di mancanegara. Perpaduan
          kopi hitam cianjur, susu putih dan racikan khas dari Coffee shop name
          memberikan sentuhan terbaik untuk .
        </div>
        <div class="bottomBtn">
          <div class="collect">
            <img src="@/assets/icons/love.svg" alt="" />
          </div>
          <div class="addCart">
            <div class="title">添加到购物车</div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script lang="ts">
import { defineComponent, ref, watch } from "vue";

export default defineComponent({
  name: "PupUp",
  props: {
    visible: {
      type: Boolean,
    },
  },
  setup(props, context) {
    let visible = ref(false);
    watch(
      () => props.visible,
      (flag) => {
        visible.value = flag;
      }
    );
    function closePopUp() {
      context.emit("closePopUp");
    }
    return {
      closePopUp,
      visible,
    };
  },
});
</script>

<style lang="less" scoped>
.modal_PopUp {
  position: fixed;
  height: 100%;
  width: 100%;
  left: 0px;
  top: 0;
  z-index: 10;
  background: rgba(0, 0, 0, 0.3);

  .modal-content {
    padding: 0px 48px;
    position: absolute;
    bottom: 0;
    background-color: #ffffff;
    border-radius: 36px 36px 0px 0px;
    overflow: hidden;
    .line {
      width: 96px;
      height: 10px;
      margin: 32px auto;
      background: #8a93a7;
      border-radius: 10px;
    }
  }
  .picture {
    width: 656px;
    height: 274px;
    background: #ebc192;
    border-radius: 16px;
    opacity: 0.26;
  }
  .describe {
    margin: 64px 0px 18px;
    font-size: 40px;
    font-family: Helvetica;
    color: #35405a;
    line-height: 48px;
  }
  .price {
    padding-bottom: 52px;
    font-size: 32px;
    font-family: Helvetica;
    color: #919bb8;
    line-height: 42px;
  }
  .offerDetails {
    padding: 40px 0px 46px;
    border-top: 2px solid #dee2ee;
    font-size: 28px;
    font-family: Helvetica;
    color: #919bb8;
    line-height: 52px;
  }
  .bottomBtn {
    display: flex;
    justify-content: space-between;
    margin-bottom: 68px;
    .collect {
      display: flex;
      justify-content: center;
      align-items: center;
      padding: 32px 48px;
      background: #ffffff;
      border-radius: 48px;
      border: 2px solid #dee2ee;
      img {
        width: 35px;
        height: 32px;
      }
    }
    .addCart {
      padding: 32px 166px;
      display: flex;
      justify-content: center;
      align-items: center;
      background: #f6a44e;
      border-radius: 48px;
      .title {
        font-size: 28px;
        font-family: Helvetica;
        color: #ffffff;
        line-height: 34px;
      }
    }
  }
}
</style>

